package com.zhan.drugStore.controller;


import com.zhan.drugStore.bean.entity.Bill;
import com.zhan.drugStore.bean.entity.Hobby;
import com.zhan.drugStore.bean.vo.BillVO;
import com.zhan.drugStore.util.BeanUtils;
import com.zhan.drugStore.util.ResponseBean;
import io.swagger.annotations.ApiOperation;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zy
 * @since 2024-07-24
 */
@RestController
@RequestMapping("/hobby")
public class HobbyController extends SuperController{

    @ApiOperation("/列表")
    @GetMapping("/list")
    public ResponseBean<List<Hobby>> getHobbyList() {
        List<Hobby> list = hobbyService.list();
        return super.resultSuccess(CollectionUtils.isEmpty(list) ? new ArrayList<>() : list);
    }
}

